/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.GrantRequest.filters;

import researchgrants.parts.GrantRequest.*;
import java.util.Collection;
import researchgrants.parts.GrantRequest.grantOfficer.GrantOfficer;

/**
 * Filter out all elements, but the ones that their grant officer is in the given Collection of GrantOfficers
 * @author ohad
 */
class GrantRequestFilterGrantOfficers implements GrantRequestFilter {

    private Collection<GrantOfficer> grantOfficers;
    
    GrantRequestFilterGrantOfficers(Collection<GrantOfficer> grantOfficers) {
        this.grantOfficers=grantOfficers;
    }

    public boolean isFiltered(GrantRequest grantRequest) {
        GrantOfficer otherGrantOfficer=grantRequest.getCurrentGrantOfficer();
        return(!grantOfficers.contains(otherGrantOfficer));
    }

}
